package com.inei.evaluacionemype.controller.activity;

import com.inei.evaluacionemype.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.RadioButton;
import android.widget.Toast;

public class CapituloIV_ParteIII_Activity extends Activity {

	// componentes
	private RadioButton rbC4_131, rbC4_132, rbC4_141, rbC4_142, rbC4_151,
			rbC4_152, rbC4_161, rbC4_162, rbC4_171, rbC4_172;

	// variables

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_capitulo_iv_parte_3);

		IniciarComponentes();

		AgregarEventos();

		CargarDatos();
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.capitulo_iv_3, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.mnGuardar:
			String resultado = Validar();
			// if (resultado.equals("")) {
			if (true) {
				GuardarDatos();
			} else {
				Toast.makeText(this, resultado, Toast.LENGTH_SHORT).show();
			}

			break;

		case R.id.mnSalir:
			finish();
			break;

		default:
			break;
		}
		return super.onOptionsItemSelected(item);
	}

	@Override
	public void onBackPressed() {
		Intent ir_cap4_2 = new Intent(this, CapituloIV_ParteII_Activity.class);
		ir_cap4_2.putExtras(getIntent().getExtras());
		startActivity(ir_cap4_2);
		finish();
		super.onBackPressed();
	}

	private void IniciarComponentes() {
		rbC4_131 = (RadioButton) findViewById(R.id.rbC4_131);
		rbC4_132 = (RadioButton) findViewById(R.id.rbC4_132);
		rbC4_141 = (RadioButton) findViewById(R.id.rbC4_141);
		rbC4_142 = (RadioButton) findViewById(R.id.rbC4_142);
		rbC4_151 = (RadioButton) findViewById(R.id.rbC4_151);
		rbC4_152 = (RadioButton) findViewById(R.id.rbC4_152);
		rbC4_161 = (RadioButton) findViewById(R.id.rbC4_161);
		rbC4_162 = (RadioButton) findViewById(R.id.rbC4_162);
		rbC4_171 = (RadioButton) findViewById(R.id.rbC4_171);
		rbC4_172 = (RadioButton) findViewById(R.id.rbC4_172);
	}

	private void AgregarEventos() {

	}

	private void CargarDatos() {

	}

	private void GuardarDatos() {
		Intent ir_cap1 = new Intent(this, CapituloI_Activity.class);
		startActivity(ir_cap1);
		finish();
	}

	private String Validar() {
		return "";
	}
}
